//
//  NullChangeStrTool.h
//  HaiDiProject
//
//  Created by Dxc_iOS on 2018/7/18.
//  Copyright © 2018年 XinMiao. All rights reserved.
//

#import <Foundation/Foundation.h>
/**
容错处理工具：NSNull类型转化成空字符串
 */
@interface NullChangeStrTool : NSObject

/**
 将 NSArray和NSDictionary所有的NSNull类型转化成@""
 */
+(id)NullChangeStr:(id)myObj;
@end

/**
   说明： 后端返回的数据中总会出现一些NSNull类型，当我们一处理程序就会崩溃，因此想到把返回的数据中的NSNull类型全部转换成@""空字符串
 
 使用：将服务器返回的数据先进行解析得到字典或者数组，将得到的数组在放进自定义类中进行转换
 
  NSArray *resultArray = [ChangeTypeTool NullChangeStr:JsonArray];
  NSDictionary *resultDic  = [ChangeTypeTool NullChangeStr:JsonDic];
 
  转换之前的字典：
 JsonDic={
 "ApiUrl" = /Api/User/uLogin.html,
 "Data" = {
 "hashid" = ee6fc8228f4b9b875262b30baa9ffa38,
 "uid" = 724,
 "mobile" = 15158164437,
 "hx_username" = <null>,
 "hx_password" = <null>,
 "nickname" = Dxccc,
 "username" = 15158164437,
 "email" = ,
 "face" = http://haidi-app.oss-cn-shenzhen.aliyuncs.com/APP/Pictrue/1528179766557.png,
 "is_first" = 1,
 },
 "Time" = 2018-07-18 09:11:37,
 "Code" = 0,
 "Msg" = 登录成功,
 }

 
 
 
 
 转换后的字典：
 resultDic = {
 ApiUrl = "/Api/User/uLogin.html";
 Code = 0;
 Data =     {
 email = "";
 face = "http://haidi-app.oss-cn-shenzhen.aliyuncs.com/APP/Pictrue/1528179766557.png";
 hashid = ee6fc8228f4b9b875262b30baa9ffa38;
 "hx_password" = "";
 "hx_username" = "";
 "is_first" = 1;
 mobile = 15158164437;
 nickname = Dxccc;
 uid = 724;
 username = 15158164437;
 };
 Msg = "\U767b\U5f55\U6210\U529f";
 Time = "2018-07-18 09:11:37";
 }

 */
